home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmMain
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Call TechScheduler API DLL"
- ClientHeight = 2175
- ClientLeft = 6585
- ClientTop = 4365
- ClientWidth = 4905
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2175
- ScaleWidth = 4905
- Begin VB.CommandButton Command1
- Caption = "Run Job"
- Height = 375
- Left = 2400
- TabIndex = 6
- Top = 1080
- Width = 2175
- End
- Begin VB.TextBox Text1
- Appearance = 0 'Flat
- Height = 288
- Left = 2280
- TabIndex = 4
- Top = 480
- Width = 2535
- End
- Begin VB.TextBox txtValue
- Appearance = 0 'Flat
- Height = 288
- Left = 2280
- TabIndex = 2
- Top = 120
- Width = 2535
- End
- Begin VB.CommandButton btnTestFunc
- Appearance = 0 'Flat
- Caption = "Load TechScheduler"
- Height = 372
- Left = 120
- TabIndex = 1
- Top = 1080
- Width = 2175
- End
- Begin VB.CommandButton btnTestProc
- Appearance = 0 'Flat
- Caption = "Kill TechScheduler"
- Height = 372
- Left = 120
- TabIndex = 0
- Top = 1560
- Width = 2175
- End
- Begin VB.Label Label2
- Caption = "Job Name:"
- Height = 255
- Left = 240
- TabIndex = 5
- Top = 480
- Width = 1935
- End
- Begin VB.Label Label1
- Caption = "Techscheduler Path"
- Height = 255
- Left = 240
- TabIndex = 3
- Top = 120
- Width = 1935
- End
- Attribute VB_Name = "frmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- ' Visual Basic 6.0 Test program for the TechScheduler API.
- ' Requires TKSHDAPI.DLL to be in the Windows or same directory.
- ' This demo can be used without any restrictions and can be
- ' modified without prior permission. We request that updates
- ' and bugs be sent to Winutils@aol.com
- ' copyright 1998-99 Dean Software Design
- ' www.winutils.com
- Option Explicit
- ' Declare the API functions in the DLL
- Private Declare Function RunScheduler Lib "TKSHDAPI.DLL" (ByVal CallerHWND As Integer, ByVal Path As String) As Integer
- Private Declare Function PauseScheduler Lib "TKSHDAPI.DLL" () As Integer
- Private Declare Function StartScheduler Lib "TKSHDAPI.DLL" () As Integer
- Private Declare Function KillScheduler Lib "TKSHDAPI.DLL" () As Integer
- Private Declare Function RunJob Lib "TKSHDAPI.DLL" (ByVal Job As String) As Integer
- Private Declare Function PauseJob Lib "TKSHDAPI.DLL" (ByVal Job As String) As Integer
- Private Declare Function StartJob Lib "TKSHDAPI.DLL" (ByVal Job As String) As Integer
- Private Declare Function DeleteJob Lib "TKSHDAPI.DLL" (ByVal Job As String) As Integer
- Private Declare Function SetJobParameter Lib "TKSHDAPI.DLL" (ByVal Job As String, ByVal ParamId As String, _
- ByVal Strdata As String, ByVal Intdata As Integer, ByVal Booldata As Boolean) As Integer
- Private Declare Function GetLastAPIError Lib "TKSHDAPI.DLL" () As Integer
- Private Declare Function ReadJobFile Lib "TKSHDAPI.DLL" (ByVal Job As String) As Integer
- Private Declare Function SetConfigParameter Lib "TKSHDAPI.DLL" (ByVal ParamId As String, _
- ByVal Strdata As String, ByVal Intdata As Integer, ByVal Booldata As Boolean) As Integer
- ' Global variables
- Dim Myresult As Integer
- Dim Mystring As String
- Private Sub btnTestFunc_Click()
- ' is there a path to pass?
- If Len(txtValue.Text) > 0 Then
- ' put the edit field value into our string variable
- Mystring = txtValue.Text
- ' run the function with the application handle
- Myresult = RunScheduler(Me.hWnd, Mystring)
- Select Case Myresult
- Case 0
- MsgBox "TechScheduler Started", vbOKOnly, "API Example"
- ' you could put other return codes here too
- Case Else
- MsgBox "TechScheduler Start Failure", vbExclamation, "API Example"
- End Select
- Else
- MsgBox "Enter TechScheduler Path", vbExclamation, "API Example"
- End If
- End Sub
- Private Sub btnTestProc_Click()
- Myresult = KillScheduler
- Select Case Myresult
- Case 0
- MsgBox "TechScheduler Killed", vbOKOnly, "API Example"
-
- Case Else
- MsgBox "TechScheduler Shutdown Failure", vbExclamation, "API Example"
- End Select
- End Sub
- Private Sub Command1_Click()
- If Len(Text1.Text) > 0 Then
- Mystring = Text1.Text
- Myresult = RunJob(Mystring)
- Select Case Myresult
- Case 0
- MsgBox "Job Started", vbOKOnly, "API Example"
- Case Else
- MsgBox "Job Start Failure", vbExclamation, "API Example"
- End Select
- Else
- MsgBox "No Job Entered", vbExclamation, "API Example"
- End If
- End Sub
-